﻿<%@ Page Title="VAP Details" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="VAP_Details.aspx.cs" Inherits="IFD2.VAP_Details" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="VAP ID:" meta:resourcekey="VAP_ID"></asp:Label><br />
                <asp:Label ID="lblEmdID" runat="server" Font-Bold="True"></asp:Label>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>--%>
                        <div class="table-responsive">
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" style="min-width:800px;width:100%;" class="table-hover"
                                DataKeyNames="airline,emd_id,lang" DataSourceID="sqlEMD_Names" ForeColor="#333333" GridLines="None">
                                <AlternatingRowStyle BackColor="White" />
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                        <input name="KEY" type="radio" value='<%# Eval("lang")%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="lang_name" HeaderText="lang_name" SortExpression="lang_name"  meta:resourcekey="lang_name" />
                                    <asp:BoundField DataField="unit" HeaderText="unit" SortExpression="unit"  meta:resourcekey="unit1" />
                                    <asp:BoundField DataField="emd_name" HeaderText="emd_name" SortExpression="emd_name"  meta:resourcekey="emd_name" />
                                    <asp:BoundField DataField="emd_note" HeaderText="emd_note" SortExpression="emd_note"  meta:resourcekey="emd_note" HtmlEncode="false" />
                                    <asp:BoundField DataField="done_user" HeaderText="done_user" SortExpression="done_user"  meta:resourcekey="done_user" />
                                    <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time"  meta:resourcekey="done_time" />
                                </Columns>
                                <EditRowStyle BackColor="#2461BF" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#EFF3FB" />
                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                <SortedDescendingHeaderStyle BackColor="#4870BE" />
                            </asp:GridView>

                            <asp:SqlDataSource ID="sqlEMD_Names" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                                SelectCommand="bll_emd_get_names" SelectCommandType="StoredProcedure">
                                <SelectParameters>
                                    <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                    <asp:ControlParameter ControlID="lblEmdID" Name="emd_id" PropertyName="Text" Type="String" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </div>
                        <asp:Button ID="btnDelete" runat="server" onclick="btnDelete_Click" Text="Delete" CssClass="btn btn-sm btn-default" meta:resourcekey="Delete" /><br />
                        <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>

                        <div class="well well-sm">
                            <asp:Label ID="Label2" runat="server" Font-Bold="True" Text="New Name:" meta:resourcekey="NewName"></asp:Label>
                            <br />
                            <div class="form-group">
                            <asp:Label ID="Label3" runat="server" Text="Language:" meta:resourcekey="Language"></asp:Label>
                            <asp:DropDownList ID="lstLang" runat="server" DataSourceID="SqlLang" DataTextField="name" DataValueField="code">
                            </asp:DropDownList>
                            </div>
                            <div class="form-group">
                            <asp:Label ID="Label4" runat="server" Text="Name:" meta:resourcekey="Name"></asp:Label>
                            <asp:TextBox ID="txtName" runat="server" MaxLength="60" Width="180px"></asp:TextBox>
                            </div>
                            <div class="form-group">
                            <asp:Label ID="Label5" runat="server" Text="Unit:" meta:resourcekey="Unit"></asp:Label>
                            <asp:TextBox ID="txtUnit" runat="server" MaxLength="10" Width="97px"></asp:TextBox>
                            </div>
                            <br class="hidden-xs" />
                            <asp:Label ID="Label6" runat="server" Text="Note:" meta:resourcekey="Note"></asp:Label>
                            <br />
                            <asp:TextBox ID="txtNote" runat="server" Height="56px" TextMode="MultiLine" style="max-width:642px;width:100%;" MaxLength="512"></asp:TextBox>
                            <br />
                            <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="Add" CssClass="btn btn-sm btn-default" meta:resourcekey="Add" />

                            <asp:SqlDataSource ID="SqlLang" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:IFD_DB %>" DataSourceMode="DataReader" 
                                SelectCommand="bll_lang_get_codes" SelectCommandType="StoredProcedure">
                            </asp:SqlDataSource>
                        </div>
                    <%--</ContentTemplate></asp:UpdatePanel>--%>

                    <asp:SqlDataSource ID="sqlCabins" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                        SelectCommand="bll_airline_get_cabin_codes" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sqlOri" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                        SelectCommand="bll_emd_get_ori_airports" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                            <asp:ControlParameter ControlID="lblEmdID" Name="emd_id" PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sqlDes" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                        SelectCommand="bll_emd_get_des_airports" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                            <asp:ControlParameter ControlID="lblEmdID" Name="emd_id" PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sqlAppCabins" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                        SelectCommand="bll_emd_get_cabins" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                            <asp:ControlParameter ControlID="lblEmdID" Name="emd_id" PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sqlAirports" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                        SelectCommand="bll_airport_get_codes" SelectCommandType="StoredProcedure">
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sqlApplyAc" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                        SelectCommand="bll_emd_get_aircrafts" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                            <asp:ControlParameter ControlID="lblEmdID" Name="emd_id" PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sqlAircrafts" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                        SelectCommand="bll_aircraft_get_tail_nos" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>

                    <div class="well well-sm">
                        <div class="table-responsive">
                            <table>
                            <tr>
                            <td style="width:25%;">
                                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                    <ContentTemplate>
                                        &bull; <asp:Label ID="Label9" runat="server" Font-Bold="True" Text="Apply To Origin Airports" meta:resourcekey="ApplyToOriginAirports"></asp:Label>
                                        <br />
                                        <table>
                                        <tr>
                                        <td style="text-align:center;">
                                            <asp:ListBox ID="lstApplyOri" runat="server" DataSourceID="sqlOri" DataTextField="ori_airport" DataValueField="ori_airport" Rows="15" Width="105px"></asp:ListBox>
                                        </td>
                                        <td style="text-align:center;">
                                            <asp:ListBox ID="lstAirports1" runat="server" DataSourceID="sqlAirports" DataTextField="code" DataValueField="code" Rows="15" SelectionMode="Multiple" Width="105px" ondatabound="lstAirports1_DataBound"></asp:ListBox>
                                        </td>
                                        </tr>
                                        <tr><td>
                                            <asp:Button ID="btnDeleteOri" runat="server" onclick="btnDeleteOri_Click" Text="Delete" CssClass="btn btn-sm btn-default" meta:resourcekey="Delete" /></td>
                                            <td><asp:Button ID="btnAddOri" runat="server" onclick="btnAddOri_Click" Text="Add" CssClass="btn btn-sm btn-default" meta:resourcekey="Add" /></td>
                                        </tr>
                                        </table>
                                        <asp:Label ID="lblErrOri" runat="server" CssClass="ifdMessage"></asp:Label>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td style="width:25%;">
                                <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                    <ContentTemplate>
                                        &bull; <asp:Label ID="Label10" runat="server" Font-Bold="True" 
                                            Text="Apply To Destination Airports" meta:resourcekey="ApplyToDestinationAirports"></asp:Label>
                                        <br />
                                        <table>
                                        <tr>
                                        <td style="text-align:center;">
                                            <asp:ListBox ID="lstApplyDes" runat="server" DataSourceID="sqlDes" DataTextField="des_airport" DataValueField="des_airport" Rows="15" Width="105px"></asp:ListBox>
                                            </td>
                                        <td style="text-align:center;">
                                            <asp:ListBox ID="lstAirports2" runat="server" DataSourceID="sqlAirports" DataTextField="code" DataValueField="code" Rows="15" SelectionMode="Multiple" Width="105px" ondatabound="lstAirports2_DataBound"></asp:ListBox>
                                            </td>
                                        </tr>
                                        <tr><td>
                                            <asp:Button ID="btnDeleteDes" runat="server" onclick="btnDeleteDes_Click" Text="Delete" CssClass="btn btn-sm btn-default" meta:resourcekey="Delete" /></td>
                                            <td><asp:Button ID="btnAddAirportDes" runat="server" onclick="btnAddAirportDes_Click" Text="Add" CssClass="btn btn-sm btn-default"  meta:resourcekey="Add" /></td>
                                        </tr>
                                        </table>
                                        <asp:Label ID="lblErrDes" runat="server" CssClass="ifdMessage"></asp:Label>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td style="width:25%;">
                                <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                                    <ContentTemplate>
                                        &bull; <asp:Label ID="Label7" runat="server" Font-Bold="True" Text="Apply To Cabins" meta:resourcekey="ApplyToCabins"></asp:Label>
                                        <br />
                                        <table>
                                        <tr><td style="text-align:center;">
                                        <asp:ListBox ID="lstApplyToCabins" runat="server" DataSourceID="sqlAppCabins" DataTextField="cabin" DataValueField="cabin" Rows="8" Width="181px">
                                        </asp:ListBox>
                                        <br />
                                        <asp:Button ID="btnDeleteCabin" runat="server" onclick="btnDeleteCabin_Click" Text="Delete" CssClass="btn btn-sm btn-default" meta:resourcekey="Delete" />
                                        <br />
                                        <br />
                                        <br />
                                        <br />
                                        </td></tr>
                                        <tr><td>
                                        <asp:Label ID="Label8" runat="server" Text="Cabin:" meta:resourcekey="Cabin"></asp:Label>
                                        &nbsp;<asp:DropDownList ID="lstCabins" runat="server" DataSourceID="sqlCabins" DataTextField="cabin" DataValueField="cabin" Width="63px">
                                        </asp:DropDownList>
                                        &nbsp;<asp:Button ID="btnAddCabin" runat="server" onclick="btnAddCabin_Click" Text="Add" CssClass="btn btn-sm btn-default" meta:resourcekey="Add" />
                                        </td>
                                        </tr>
                                        </table>
                                        &nbsp;<asp:Label ID="lblErrCabin" runat="server" CssClass="ifdMessage"></asp:Label>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td style="width:25%;">
                                <asp:UpdatePanel ID="UpdatePanel5" runat="server">
                                    <ContentTemplate>
                                        &nbsp;<asp:Label ID="Label11" runat="server" Text="Apply To Aircrafts_X" Visible="false" Font-Bold="True" meta:resourcekey="ApplyToAircrafts"></asp:Label>
                                        <table>
                                        <tr>
                                        <td style="text-align:center;">
                                            <asp:ListBox ID="lstApplyAc" runat="server" DataSourceID="sqlApplyAc" DataTextField="tail_no" DataValueField="tail_no" Rows="15" Width="105px" Visible="False"></asp:ListBox>
                                            </td>
                                        <td style="text-align:center;">
                                            <asp:ListBox ID="lstAircrafts" runat="server" DataSourceID="sqlAircrafts" DataTextField="tail_no" DataValueField="tail_no" Rows="15" SelectionMode="Multiple" Width="105px" ondatabound="lstAircrafts_DataBound" Visible="False"></asp:ListBox>
                                            </td>
                                        </tr>
                                        <tr><td>
                                            <asp:Button ID="btnDeleteAC" runat="server" onclick="btnDeleteAC_Click" Text="Delete" CssClass="btn btn-sm btn-default" meta:resourcekey="Delete" Visible="False" /></td>
                                            <td><asp:Button ID="btnAddAc" runat="server" onclick="btnAddAc_Click" Text="Add" CssClass="btn btn-sm btn-default" meta:resourcekey="Add" Visible="False" /></td>
                                        </tr>
                                        </table>
                                        &nbsp;<asp:Label ID="lblErrAc" runat="server" CssClass="ifdMessage" Visible="False"></asp:Label>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    </div>
    </form>

</asp:Content>
